class Magicer extends Role{
    private int level;

    @Override
    public int attack() {
        return level * 5;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }
}
class Soldier extends Role{
    private int hurt;

    @Override
    public int attack() {
        return hurt;
    }

    public int getHurt() {
        return hurt;
    }

    public void setHurt(int hurt) {
        this.hurt = hurt;
    }
}
class Team{
    List team = new ArrayList<>();
    public void addRoles(Role r){
        team.add(r);
    }
    public int attackSum(){
        int sum = 0;
        for (int i = 0; i < team.size(); i++) {
            if (team.get(i) instanceof Magicer){
                sum += ((Magicer) team.get(i)).attack();
            }else {
                sum += ((Soldier) team.get(i)).attack();
            }
        }
        return sum;
    }
}